package com.sise.parkinglot.controller;


import com.sise.parkinglot.bean.CodeMsg;
import com.sise.parkinglot.entity.Admin;
import com.sise.parkinglot.service.IAdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author ZJ
 */
@RestController
@RequestMapping("/parkinglot/admin")
public class AdminController {

    @Resource
    private IAdminService iAdminService;

    @PostMapping("/login")
    public CodeMsg<String> login(@RequestBody Admin admin) {
        return iAdminService.login(admin);
    }

    @PostMapping("/addAdmin")
    public CodeMsg<String> addAdmin(@RequestBody Admin admin) {
        return iAdminService.addAdmin(admin);
    }
}
